import uuid
from Connector.client import res_success
from service.func.render_mode import render_mode


class CmdRenderMode:
    name = "cmd_render_mode.py"
    id = uuid.uuid4()

    def __init__(self, service, Params, Tag, Type):
        self.service = service
        self.params = Params
        self.tag = Tag
        self.type = Type

    async def execute(self):
        mode = self.params.get("mode")
        render_mode(self.service, mode)
        await res_success(self.tag, self.type, {"status": "success"})
